<html>
    <head>
        <title>
            HSBN Technologies | Contact Us
        </title>
    </head>
<?php
include("inc/conn.php");
?>
<body>
    <form name="contact_us" method="post" action="contact_us.php">
        <table>
            <tr>
                <td>First Name*:</td>
                <td><input type="text" name="first_name" value="" /></td></tr>
                <tr><td>Last Name*:</td>
                <td><input type="text" name="last_name" value="" /></td></tr>
                <tr><td>Phone No(M)*:</td>
                <td><input type="text" name="phone_mob" value="" /></td><tr>
                <tr><td>Phone No(O):</td>
                <td><input type="text" name="phone_ofc" value="" /></td></tr>
                <tr><td>Email Address*:</td>
                <td><input type="text" name="email1" value="" /></td></tr>
                <tr><td>Emai Address(Alternate):</td>
                <td><input type="text" name="email_alt" value="" /></td></tr>
                <tr><td>Your Comment:</td>
                <td><textarea rows="10" cols="35" name="comment"></textarea></td>
            </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="Submit" />
                    <input type="reset" value="Reset" /></td>
                </tr>
        </table>
    </form>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST")
{
    $first_name = mysql_real_escape_string($_POST['first_name']);
    $last_name = mysql_real_escape_string($_POST['last_name']);
    $phone_mob = mysql_real_escape_string($_POST['phone_mob']);
    $phone_ofc = mysql_real_escape_string($_POST['phone_ofc']);
    $email1 = mysql_real_escape_string($_POST['email1']);
    $email_alt = mysql_real_escape_string($_POST['email_alt']);
    $comment = mysql_real_escape_string($_POST['comment']);
    $sql = "insert into contact(first_name,last_name,phone_mob,phone_ofc,email1,email_alt,comment,date,time) values ('$first_name','$last_name','$phone_mob','$phone_ofc','$email1','$email_alt','$comment',now(),now());";
    $result=mysql_query($sql);
    if(!$result)
    {
        echo "couldn't submit your comment" . mysql_error();
    }
    else
    {
        echo "Your comment has been send successfully";
    }
} 
?>
</body>
</html>
